import Vue from 'vue'
import VueRouter from 'vue-router'
import index from '../views/index.vue'
import sort from '../views/sort.vue'
import car from '../views/car.vue'
import my from '../views/my.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/index',
    name: 'index',
    component: index
  },
  {
    path: '/sort',
    name: 'sort',
    component:sort
  },
  {
    path: '/car',
    name: 'car',
    component: car
  },
  {
    path: '/my',
    name: 'my',
    component: my
  },
  {
    path:"/",
    redirect:"/index"
  },
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
